import React from "react";
import Card from "../../components/Card";
import AppTypeRadio from "../../components/AppTypeRadio";
import { DatePicker } from "antd";
import "./style.scss";

const { RangePicker } = DatePicker;

function GeneralCard(props) {
    return (
        <Card
            title={props.title}
            suffix={
                <RangePicker
                    className="dayu-date-picker"
                    dropdownClassName="dayu-date-dropdown"
                    size="small"
                    onChange={props.onDateChange}
                />
            }
        >
            <div className="GeneralCard">
                <div className="GeneralCard-chart">{props.children}</div>
                <div className="GeneralCard-radio">
                    <AppTypeRadio onChange={props.onAppTypeChange} />
                </div>
            </div>
        </Card>
    );
}

export default GeneralCard;
